<ul class="menu">
<?PHP
$catinfo = getRecord("tbl_product_category", "id=" . $cat);
$parentCode = $_lang == 'vn' ? 'vn' : 'en';
$sqlParent = "select * from tbl_product_category where status=0 and parent=(select id from tbl_product_category where code='" .
    $parentCode . "') order by sort, date_added";
$resultParent = mysql_query($sqlParent, $conn);
while ($rowParent = mysql_fetch_assoc($resultParent)) {
    $isHaveChild = isHaveChild("tbl_product_category", $rowParent['id']) ? 0 : 1;
    $strLinkFriendly = unicodeToNonUnicode($rowParent['name']);
?>
    <li><a href="/khohangtot/list-product/<?= $rowParent['id'] ?>/<?=$strLinkFriendly?>.htm" class="parent"><span><?= $rowParent['name'] ?></span></a>
        <div>
            <ul>
                <?
                    $sqlChild = "select * from tbl_product_category where status=0 and parent='" . $rowParent['id'] .
                        "' order by sort, date_added";
                    $resultChild = mysql_query($sqlChild, $conn);
                    while ($rowChild = mysql_fetch_assoc($resultChild)) {
                    $strLinkFriendly = unicodeToNonUnicode($rowChild['name']);
                ?>
                <li><a title="khohangtot|do gia dung" href="/khohangtot/list-product/<?= $rowChild['id'] ?>/<?=$strLinkFriendly?>.htm"><span><?= $rowChild['name'] ?></span></a></li>
                <? } ?>
            </ul>
        </div>
    </li>
<? } ?>
</ul>
